package com.xwj.client;

import com.xwj.dto.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author xwj
 * @date 2020/6/16
 */
@Component
@FeignClient(value = "cloud-auth-service", fallback = AuthServiceFallBack.class)
public interface AuthServiceClient {
    /**
     * 调用cloud-auth-service服务登录并获取token
     *
     * @param username
     * @param password
     * @return
     */
    @PostMapping("/oauth/token")
    Object login(@RequestParam("client_id") String clientId, @RequestParam("client_secret") String clientSecret,
                       @RequestParam("grant_type") String grantType, @RequestParam("username") String username, @RequestParam("password") String password);
}
